type ResoveType = (resove_success: any) => any;
type RejectType = (reject_success: any) => any;

class Promise {
  public resolveFunc!: ResoveType;
  public rejectFunc!: RejectType;
  // 这里的 resove ，不是传值形参，只是函数类型中的形参,只做传参验证用，不做传参用
  constructor(promiseParams: (resove: ResoveType, reject: RejectType) => any) {
    this.resolveFunc = (resove_success: any): any => {
      console.log('resove_success-----', resove_success);
    };
    this.rejectFunc = (reject_fail: any): any => {
      console.log(reject_fail);
    };
    // this.resolveFunc 是第一个参数，对应constructor 的 promiseParams 参数的参数resove
    promiseParams(this.resolveFunc, this.rejectFunc);
  }
}

new Promise(function (resove: ResoveType, reject: RejectType): any {
  resove('成功了');
});

export {};
